```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OSI七层模型详解 - 网络通信的基石</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            background-color: #f8f9fa;
        }
        h1, h2, h3, h4, .serif {
            font-family: 'Noto Serif SC', serif;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .layer-card {
            transition: all 0.3s ease;
        }
        .layer-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        }
        .protocol-tag {
            transition: all 0.2s ease;
        }
        .protocol-tag:hover {
            transform: scale(1.05);
        }
        .mermaid {
            background-color: white;
            border-radius: 0.75rem;
            padding: 1.5rem;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <div class="hero-gradient text-white py-20 px-4 md:px-0">
        <div class="container mx-auto px-4 md:px-6 max-w-5xl text-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-4 serif">OSI 七层模型</h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">网络通信的结构化框架</p>
            <div class="max-w-3xl mx-auto bg-white bg-opacity-10 p-6 rounded-xl backdrop-filter backdrop-blur-sm">
                <p class="text-lg md:text-xl leading-relaxed">OSI 七层模型是由国际标准化组织(ISO)制定的网络通信模型，它将复杂的网络通信过程划分为七个逻辑层次，每一层都有其独特的功能和职责，共同构建了现代网络通信的基础架构。</p>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="container mx-auto px-4 md:px-6 py-12 max-w-5xl">
        <!-- Introduction -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-6 serif text-gray-800 border-b pb-2">模型概述</h2>
            <div class="bg-white rounded-xl shadow-md p-6">
                <p class="text-gray-700 leading-relaxed mb-4">OSI(开放系统互连)模型是一个概念性框架，用于描述计算机网络中数据的传输和通信过程。它将网络通信过程划分为七个层次，每一层都承担特定的功能，并通过接口与相邻层进行交互。</p>
                <p class="text-gray-700 leading-relaxed">这个模型不仅帮助工程师设计和实现网络协议，还为网络问题的排查提供了系统化的方法。理解每一层的功能和协议，是掌握计算机网络知识的基础。</p>
            </div>
        </section>

        <!-- Visualization -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-6 serif text-gray-800 border-b pb-2">模型可视化</h2>
            <div class="mermaid">
                graph TD
                    A[应用层] -->|HTTP FTP SMTP| B[表示层]
                    B -->|加密/解密 数据格式转换| C[会话层]
                    C -->|建立/管理/终止会话| D[传输层]
                    D -->|TCP UDP| E[网络层]
                    E -->|IP ICMP| F[数据链路层]
                    F -->|Ethernet Wi-Fi| G[物理层]
                    G -->|比特流| H[物理介质]
                    style A fill:#4e79a7,stroke:#333,color:white
                    style B fill:#f28e2b,stroke:#333,color:white
                    style C fill:#e15759,stroke:#333,color:white
                    style D fill:#76b7b2,stroke:#333,color:white
                    style E fill:#59a14f,stroke:#333,color:white
                    style F fill:#edc948,stroke:#333,color:black
                    style G fill:#b07aa1,stroke:#333,color:white
            </div>
        </section>

        <!-- Layers Details -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-6 serif text-gray-800 border-b pb-2">层次详解</h2>
            <div class="grid gap-6">
                <!-- Layer 7 -->
                <div class="layer-card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="flex flex-col md:flex-row">
                        <div class="md:w-1/4 bg-indigo-600 text-white p-6 flex items-center justify-center">
                            <div>
                                <div class="text-5xl font-bold mb-2">7</div>
                                <h3 class="text-2xl font-bold serif">应用层</h3>
                                <p class="opacity-80">Application Layer</p>
                            </div>
                        </div>
                        <div class="md:w-3/4 p-6">
                            <p class="text-gray-700 mb-4">负责应用程序和网络之间的交互，提供各种网络服务和应用程序接口。处理最终用户的数据和服务请求，如电子邮件、文件传输、网页浏览等。</p>
                            <div class="flex flex-wrap gap-2">
                                <span class="protocol-tag bg-indigo-100 text-indigo-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-globe mr-1"></i> HTTP</span>
                                <span class="protocol-tag bg-indigo-100 text-indigo-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-file-upload mr-1"></i> FTP</span>
                                <span class="protocol-tag bg-indigo-100 text-indigo-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-envelope mr-1"></i> SMTP</span>
                                <span class="protocol-tag bg-indigo-100 text-indigo-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-search mr-1"></i> DNS</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Layer 6 -->
                <div class="layer-card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="flex flex-col md:flex-row">
                        <div class="md:w-1/4 bg-orange-500 text-white p-6 flex items-center justify-center">
                            <div>
                                <div class="text-5xl font-bold mb-2">6</div>
                                <h3 class="text-2xl font-bold serif">表示层</h3>
                                <p class="opacity-80">Presentation Layer</p>
                            </div>
                        </div>
                        <div class="md:w-3/4 p-6">
                            <p class="text-gray-700 mb-4">负责数据的格式化、加密和解密，确保应用层能够理解数据的语法和语义。处理数据的表示、编码和转换，确保不同系统之间的数据兼容性。</p>
                            <div class="flex flex-wrap gap-2">
                                <span class="protocol-tag bg-orange-100 text-orange-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-image mr-1"></i> JPEG</span>
                                <span class="protocol-tag bg-orange-100 text-orange-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-film mr-1"></i> MPEG</span>
                                <span class="protocol-tag bg-orange-100 text-orange-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-lock mr-1"></i> TLS/SSL</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Layer 5 -->
                <div class="layer-card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="flex flex-col md:flex-row">
                        <div class="md:w-1/4 bg-red-500 text-white p-6 flex items-center justify-center">
                            <div>
                                <div class="text-5xl font-bold mb-2">5</div>
                                <h3 class="text-2xl font-bold serif">会话层</h3>
                                <p class="opacity-80">Session Layer</p>
                            </div>
                        </div>
                        <div class="md:w-3/4 p-6">
                            <p class="text-gray-700 mb-4">负责在不同主机之间建立、管理和终止会话（对话）。它处理会话的建立、维持和结束，支持会话恢复和同步。管理应用程序之间的对话和数据交换。</p>
                            <div class="flex flex-wrap gap-2">
                                <span class="protocol-tag bg-red-100 text-red-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-exchange-alt mr-1"></i> RPC</span>
                                <span class="protocol-tag bg-red-100 text-red-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-network-wired mr-1"></i> NetBIOS</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Layer 4 -->
                <div class="layer-card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="flex flex-col md:flex-row">
                        <div class="md:w-1/4 bg-teal-500 text-white p-6 flex items-center justify-center">
                            <div>
                                <div class="text-5xl font-bold mb-2">4</div>
                                <h3 class="text-2xl font-bold serif">传输层</h3>
                                <p class="opacity-80">Transport Layer</p>
                            </div>
                        </div>
                        <div class="md:w-3/4 p-6">
                            <p class="text-gray-700 mb-4">负责数据的端到端传输，提供端口之间的通信，确保数据的完整性和顺序。处理数据的流量控制、错误检测和纠正。</p>
                            <div class="flex flex-wrap gap-2">
                                <span class="protocol-tag bg-teal-100 text-teal-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-shield-alt mr-1"></i> TCP</span>
                                <span class="protocol-tag bg-teal-100 text-teal-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-bolt mr-1"></i> UDP</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Layer 3 -->
                <div class="layer-card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="flex flex-col md:flex-row">
                        <div class="md:w-1/4 bg-green-600 text-white p-6 flex items-center justify-center">
                            <div>
                                <div class="text-5xl font-bold mb-2">3</div>
                                <h3 class="text-2xl font-bold serif">网络层</h3>
                                <p class="opacity-80">Network Layer</p>
                            </div>
                        </div>
                        <div class="md:w-3/4 p-6">
                            <p class="text-gray-700 mb-4">负责将数据包从源设备路由到目标设备，处理逻辑地址（如 IP 地址），并进行路由选择和数据包转发。提供不同网络之间的互联，管理网络中的数据包传输。</p>
                            <div class="flex flex-wrap gap-2">
                                <span class="protocol-tag bg-green-100 text-green-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-route mr-1"></i> IP</span>
                                <span class="protocol-tag bg-green-100 text-green-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-search mr-1"></i> ICMP</span>
                                <span class="protocol-tag bg-green-100 text-green-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-address-card mr-1"></i> ARP</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Layer 2 -->
                <div class="layer-card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="flex flex-col md:flex-row">
                        <div class="md:w-1/4 bg-yellow-400 text-gray-900 p-6 flex items-center justify-center">
                            <div>
                                <div class="text-5xl font-bold mb-2">2</div>
                                <h3 class="text-2xl font-bold serif">数据链路层</h3>
                                <p class="opacity-80">Data Link Layer</p>
                            </div>
                        </div>
                        <div class="md:w-3/4 p-6">
                            <p class="text-gray-700 mb-4">负责在相邻节点之间的链路上建立、维护和断开逻辑链接。它将物理层的比特流转化为数据帧，并提供错误检测和纠正。处理数据的帧结构、流量控制和差错控制。</p>
                            <div class="flex flex-wrap gap-2">
                                <span class="protocol-tag bg-yellow-100 text-yellow-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-ethernet mr-1"></i> Ethernet</span>
                                <span class="protocol-tag bg-yellow-100 text-yellow-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-wifi mr-1"></i> Wi-Fi</span>
                                <span class="protocol-tag bg-yellow-100 text-yellow-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-link mr-1"></i> PPP</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Layer 1 -->
                <div class="layer-card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="flex flex-col md:flex-row">
                        <div class="md:w-1/4 bg-purple-600 text-white p-6 flex items-center justify-center">
                            <div>
                                <div class="text-5xl font-bold mb-2">1</div>
                                <h3 class="text-2xl font-bold serif">物理层</h3>
                                <p class="opacity-80">Physical Layer</p>
                            </div>
                        </div>
                        <div class="md:w-3/4 p-6">
                            <p class="text-gray-700 mb-4">负责在物理介质上进行数据的实际传输。它定义了电气信号、光信号、无线信号等的传输特性以及物理连接的机械和电气规范。处理数据的比特流（即0和1），定义如何将比特流在物理介质上传输。</p>
                            <div class="flex flex-wrap gap-2">
                                <span class="protocol-tag bg-purple-100 text-purple-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-plug mr-1"></i> Ethernet</span>
                                <span class="protocol-tag bg-purple-100 text-purple-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-usb mr-1"></i> USB</span>
                                <span class="protocol-tag bg-purple-100 text-purple-800 px-3 py-1 rounded-full text-sm"><i class="fas fa-phone-alt mr-1"></i> DSL</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Comparison Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-6 serif text-gray-800 border-b pb-2">层次对比</h2>
            <div class="bg-white rounded-xl shadow-md p-6">
                <div class="overflow-x-auto">
                    <table class="min-w-full divide-y divide-gray-200">
                        <thead class="bg-gray-50">
                            <tr>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">层次</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">主要功能</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">数据单位</th>
                            </tr>
                        </thead>
                        <tbody class="bg-white divide-y divide-gray-200">
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap font-medium text-indigo-600">应用层</td>
                                <td class="px-6 py-4">应用程序和网络服务的接口</td>
                                <td class="px-6 py-4">数据/消息</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap font-medium text-orange-500">表示层</td>
                                <td class="px-6 py-4">数据格式转换和加密</td>
                                <td class="px-6 py-4">数据/消息</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap font-medium text-red-500">会话层</td>
                                <td class="px-6 py-4">建立、管理和终止会话</td>
                                <td class="px-6 py-4">数据/消息</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap font-medium text-teal-500">传输层</td>
                                <td class="px-6 py-4">端到端数据传输管理</td>
                                <td class="px-6 py-4">数据段</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap font-medium text-green-600">网络层</td>
                                <td class="px-6 py-4">数据包路由和转发</td>
                                <td class="px-6 py-4">数据包</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap font-medium text-yellow-500">数据链路层</td>
                                <td class="px-6 py-4">相邻节点间的数据传输</td>
                                <td class="px-6 py-4">数据帧</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap font-medium text-purple-600">物理层</td>
                                <td class="px-6 py-4">物理介质上的比特流传输</td>
                                <td class="px-6 py-4">比特</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </section>

        <!-- Summary -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-6 serif text-gray-800 border-b pb-2">总结</h2>
            <div class="bg-white rounded-xl shadow-md p-6">
                <p class="text-gray-700 leading-relaxed mb-4">OSI 七层模型提供了一个结构化的框架，帮助理解和实现网络通信的各个方面。从底层的物理传输到顶层的应用服务，每一层都有其独特的功能和协议，共同构建了现代互联网的基础架构。</p>
                <p class="text-gray-700 leading-relaxed">理解这个模型对于网络工程师和开发人员至关重要，它不仅有助于网络协议的设计和实现，也为网络问题的排查提供了系统化的方法。在实际应用中，虽然TCP/IP协议栈更为常用，但OSI模型仍然是学习和理解网络通信原理的重要工具。</p>
            </div>
        </section>
    </div>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8">
        <div class="container mx-auto px-4 md:px-6 max-w-5xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white mb-2">技术小馆</h3>
                    <p class="text-gray-400">探索技术的无限可能</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-indigo-400 hover:text-indigo-300 transition-colors duration-200">
                        <i class="fas fa-external-link-alt mr-2"></i>www.yuque.com/jtostring
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```